//协议
let protocoll = process.env.NODE_ENV === 'production' ? 'https' : 'https';

//mock环境
const mock_baseUrl = `${protocoll}://101.200.54.239:7777/mock/5c1f5f763b9c0c22d4b7bbb7`;
//开发(联调)环境
const dev_baseUrl = `https://aryssl.test.datounet.com`;
//测试环境
const test_baseUrl = `${protocoll}://api-ary-qa.datounet.com`;
//生产环境
const pro_baseUrl = `${protocoll}://apiaryv3.ishangtui.com`;

//前端域名
let currentUrl = '';
switch (process.env.NODE_ENV) {
    case 'mock':
        currentUrl = mock_baseUrl;
        break;
    case 'development':
        currentUrl = dev_baseUrl;
        break;
    case 'test':
        currentUrl = test_baseUrl;
        break;
    case 'production':
        currentUrl = pro_baseUrl;
        break;
}
console.log(`当前环境2：${process.env.NODE_ENV}`, `baseUrl:${currentUrl}`, `protocol:${window.protocol}`, `domain:${window.domain}`);
// export const baseUrl = 'http://api.ary.qa.test.datounet.com';
export const baseUrl = currentUrl;
export const protocol = currentUrl.substr(0, 5);
//高德地图api凭据-3.0
export const amapKey = 'cb4bce6bc425f244ce756510acbcecb6';

//静态图片域名 - OSS
export const oss_baseUrl = `${protocol}://iryoss3-0.oss-cn-beijing.aliyuncs.com`;

//错误码常量
export const errCode = {
    5001001: '未获取到token',
    5001002: '无效的token',
    5001003: '注册失败',
    5001004: '用户异常'
};

// //协议
// let protocol1 = window.protocol ? window.protocol : 'http'
//
// //mock环境
// const mock_baseUrl = `${protocol1}://101.200.54.239:7777/mock/5c1f5f763b9c0c22d4b7bbb7`;
// //开发(联调)环境
// const dev_baseUrl = `${protocol1}://api.ary.dev.test.datounet.com`;
// //测试环境
// const test_baseUrl = `${protocol1}://api.ary.dev.test.datounet.com`;
// //生产环境
// const pro_baseUrl = `${protocol1}://api.ary.dev.test.datounet.com`;
//
//
// //前端域名
// let currentUrl = '';
// let win_baseUrl = '';
// switch (process.env.NODE_ENV) {
//     case 'mock':
//         currentUrl = mock_baseUrl;
//         break;
//     case 'development':
//         currentUrl = dev_baseUrl;
//         break;
//     case 'test':
//         win_baseUrl = `${protocol1}://${window.domain}`;
//         currentUrl = test_baseUrl;
//         break;
//     case 'production':
//         win_baseUrl = `${protocol1}://${window.domain}`; //生产环境根据部署域名 设置api访问域名
//         currentUrl = window.domain ? win_baseUrl : pro_baseUrl;
//         break;
// }
// console.log(`当前环境：${process.env.NODE_ENV}`, `baseUrl:${currentUrl}`,`protocol:${window.protocol}`,`domain:${window.domain}`);
// export const baseUrl = currentUrl;
//
// //高德地图api凭据-3.0
// export const amapKey = 'cb4bce6bc425f244ce756510acbcecb6';
//
// //静态图片域名 - OSS
// export const oss_baseUrl = `${protocol1}://iryoss3-0.oss-cn-beijing.aliyuncs.com`;
// export const protocol = currentUrl.substr(0,4);
// //错误码常量
// export const errCode = {
//     5001001: '未获取到token',
//     5001002: '无效的token',
//     5001003: '注册失败',
//     5001004: '用户异常'
// };
